package com.java.struts.user.entity;

import com.java.struts.base.entity.BaseEntity;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
/**
 * 用户实体类
 * */
@Entity
@Table(name = "userinfo", schema = "isfull")
public class UserinfoEntity extends BaseEntity {
    private int uid;
    private String userNo;
    private String upwd;
/**
 *  用户ID
 * */
    @Id
    @Column(name = "Uid")
    //指定主键生成器
    @GenericGenerator(name = "uiduUuid", strategy = "increment")
    //使用哪个主键主键生成器
    @GeneratedValue(generator = "uiduUuid")
    public int getUid() {
        return uid;
    }

    public void setUid(int uid) {
        this.uid = uid;
    }
/**
 *  用户名称
 * */
    @Basic
    @Column(name = "UserNo")
    public String getUserNo() {
        return userNo;
    }

    public void setUserNo(String userNo) {
        this.userNo = userNo;
    }
/**
 *  用户密码
 * */
    @Basic
    @Column(name = "Upwd")
    public String getUpwd() {
        return upwd;
    }

    public void setUpwd(String upwd) {
        this.upwd = upwd;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        UserinfoEntity that = (UserinfoEntity) o;

        if (uid != that.uid) return false;
        if (userNo != null ? !userNo.equals(that.userNo) : that.userNo != null) return false;
        if (upwd != null ? !upwd.equals(that.upwd) : that.upwd != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = uid;
        result = 31 * result + (userNo != null ? userNo.hashCode() : 0);
        result = 31 * result + (upwd != null ? upwd.hashCode() : 0);
        return result;
    }
}
